/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package memory;

import java.util.ArrayList;

/**
 *
 * @author Erdiansyah
 */
public class Category {

    private String categoryname;
    private String categorycode;
    private ArrayList<SubCategory> subcategorylList;

    Category(String cn, String cc) {
        categoryname = cn;
        categorycode = cc;
    }

    public String getCategorycode() {
        return categorycode;
    }

    public void setCategorycode(String categorycode) {
        this.categorycode = categorycode;
    }

    public String getCategoryname() {
        return categoryname;
    }

    public void setCategoryname(String categoryname) {
        this.categoryname = categoryname;
    }

    public ArrayList<SubCategory> getSubcategorylList() {
        return subcategorylList;
    }

    public void setSubcategorylList(ArrayList<SubCategory> subcategorylList) {
        this.subcategorylList = subcategorylList;
    }

    public void addToSubCategoryList(SubCategory subcat){
        this.subcategorylList.add(subcat);
    }

    public void removeSubCategoryFromList(SubCategory subcat){
        this.subcategorylList.remove(subcat);
    }

    public int getIndexOfSubCategory(SubCategory subcat){
        return subcategorylList.indexOf(subcat);
    }

}
